package shared

import scala.math.BigDecimal.RoundingMode
import Implicits._

/**
 * Created by yz on 2019/4/24
 */

case class ResultData(score: BigDecimal)


object Shared {

  val userStr = "boost_user"
  val adminStr = "boost_admin"

  def calculateScore(resultData: ResultData) = {
    val score = resultData.score
    score.toFixed(2)
  }

  def getResult(score: BigDecimal) = {
    score match {
      case x if x <= 0 && x >= -1 => "评分结果正常"
      case x if x > 0 && x <= 1 => "初步提示糖尿病"
    }

  }


}
